---
id: "set-decorator"
keywords: ["set", "decorator"]
name: "@set"
summary: "This is the `@set` decorator."
category: "decorators"
---

The `@set` decorator is used to set a property of an object.

### Example

<CodeTab labels={["ReScript", "JS Output"]}>

```res
type window
@val external window: window = "window"
@set external setName: (window, string) => unit = "name"

setName(window, "MyWindow")
```

```js
window.name = "MyWindow";
```

</CodeTab>

### References

- [Record Field Access](../docs/manual/bind-to-js-object.mdx#record-field-access)
